Create Simple Login Page with PHP and MySQL | 您所在的位置:网站首页 › how to create a contact page with php › Create Simple Login Page with PHP and MySQL |
Login page allows the registered user to access the website and manage its account by entering its username and password. User SESSION is been created on a successful login attempt. This helps to detect the user is actually logged in or not when going to other web pages and it also helps to display content according to the user. In this tutorial, I show how you can create a Login page with PHP and MySQL. Demo 聽DownloadContentsTable structureConfigurationHTMLCSSPHPDemoConclusion1. Table structureI am using users table in the tutorial example. CREATE TABLE `users` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `username` varchar(80) NOT NULL, `name` varchar(80) NOT NULL, `password` varchar(80) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;2. ConfigurationCreate config.php file for database configuration. Completed Code Homepage 6.聽DemoView Demo 7.聽ConclusionIn this tutorial, I showed how you can create a simple login page with PHP and MySQL. You must have to initialize the $_SESSION variable to detect the user when traversing to other pages and destroy it when the user clicks the logout buttons. If you want to know how to create a register page then you can view the following tutorial. If you found this tutorial helpful then don't forget to share. |
CopyRight 2018-2019 实验室设备网 版权所有 |